package com.zeyu.framework.tools.console.entity;

/**
 * SSH 协议参数配置类
 * Created by zeyuphoenix on 16/10/17.
 */
public class SSHConfiguration extends BasicConfiguration {

    // ================================================================
    // Constants
    // ================================================================

    // ================================================================
    // Fields
    // ================================================================

    // Network parameters
    /**
     * The port the SSH server is listening on, usually 22. This parameter is optional.
     * If this is not specified, the default of 22 will be used.
     */
    private int port = 22;

    // Authentication
    /**
     * The username to use to authenticate, if any. This parameter is optional.
     * If not specified, you will be prompted for the username upon connecting.
     */
    private String username;
    /**
     * The password to use when attempting authentication, if any. This parameter is optional.
     * If not specified, you will be prompted for your password upon connecting.
     */
    private String password;
    /**
     * The entire contents of the private key to use for public key authentication.
     * If this parameter is not specified, public key authentication will not be used.
     * The private key must be in OpenSSH format, as would be generated by the OpenSSH ssh-keygen utility.
     */
    private String private_key;
    /**
     * The passphrase to use to decrypt the private key for use in public key authentication.
     * This parameter is not needed if the private key does not require a passphrase.
     * If the private key requires a passphrase, but this parameter is not provided,
     * the user will be prompted for the passphrase upon connecting.
     */
    private String passphrase;

    // Display settings
    /**
     * The color scheme to use for the terminal emulator used by SSH connections.
     * Each color scheme dictates the default foreground and background color for the terminal.
     * Programs which specify colors when printing text will override these defaults.
     *
     * black-white|gray-black|green-black|white-black
     */
    private String color_scheme;
    /**
     * The name of the font to use. This parameter is optional.
     * If not specified, the default of "monospace" will be used instead.
     */
    private String font_name;
    /**
     * The size of the font to use, in points. This parameter is optional.
     * If not specified, the default of 12 will be used instead.
     */
    private int font_size = 12;

    /**
     * The command to execute over the SSH session
     */
    private String command;

    // SFTP
    // provides support for file transfer over SSH using SFTP,
    // the file transfer protocol built into most SSH servers.
    /**
     * Whether file transfer should be enabled. If set to "true", the user will be allowed to
     * upload or download files from the specified server using SFTP. If omitted, SFTP will be disabled.
     */
    private boolean enable_sftp = false;

    // ================================================================
    // Constructors
    // ================================================================

    // ================================================================
    // Methods from/for super Interfaces or SuperClass
    // ================================================================

    @Override
    public String getProtocol() {
        return ConsoleParam.TYPE_SSH;
    }

    // ================================================================
    // Public or Protected Methods
    // ================================================================

    // ================================================================
    // Getter & Setter
    // ================================================================

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPrivate_key() {
        return private_key;
    }

    public void setPrivate_key(String private_key) {
        this.private_key = private_key;
    }

    public String getPassphrase() {
        return passphrase;
    }

    public void setPassphrase(String passphrase) {
        this.passphrase = passphrase;
    }

    public String getColor_scheme() {
        return color_scheme;
    }

    public void setColor_scheme(String color_scheme) {
        this.color_scheme = color_scheme;
    }

    public String getFont_name() {
        return font_name;
    }

    public void setFont_name(String font_name) {
        this.font_name = font_name;
    }

    public int getFont_size() {
        return font_size;
    }

    public void setFont_size(int font_size) {
        this.font_size = font_size;
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public boolean isEnable_sftp() {
        return enable_sftp;
    }

    public void setEnable_sftp(boolean enable_sftp) {
        this.enable_sftp = enable_sftp;
    }

    // ================================================================
    // Private Methods
    // ================================================================

    // ================================================================
    // Inner or Anonymous Class
    // ================================================================

    // ================================================================
    // Test Methods
    // ================================================================

}
